﻿using UnityEngine;
using UnityEngine.UI;
using UnityEditor;

namespace LightGameLibs.Editor
{
    [CustomEditor(typeof(LightGameLibs.RichLocalText))]
    public class RichLocalText : UnityEditor.Editor
    {
        private LightGameLibs.RichLocalText m_target;
        private Vector2 m_scrollPos;
        private Text m_text;

        void OnEnable()
        {
            m_target = (LightGameLibs.RichLocalText)target;
            m_text = m_target.GetComponent<Text>();
        }

        public override void OnInspectorGUI()
        {
            EditorUtil.CombinableRichTextArgEditor(m_target.m_textArg);

            m_text.text = m_target.m_textArg.GetCombinableRichText(m_text.color, m_text.fontSize, m_text.fontStyle);
        }
    }
}
